package cn.codeinn.service2.controller;

import cn.codeinn.generator.util.Page;
import cn.codeinn.service2.service.DictSimpleCategoryService;
import cn.codeinn.service2.vo.DictInfoVO;
import cn.codeinn.service2.vo.DictSimpleCategoryInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Api
@RequestMapping(value = "/dictSimple")
public class DictSimpleController {

    @Resource
    private DictSimpleCategoryService dictSimpleCategoryService;

    @ApiOperation("查询简单工艺分类")
    @GetMapping(value = "/categorys")
    public Page<DictSimpleCategoryInfoVO> selectSimpleCategoryInfo() {
        return dictSimpleCategoryService.selectSimpleCategory();
    }

    @ApiOperation("查询工艺")
    @GetMapping(value = "/dicts")
    public Page<DictInfoVO> selectDictInfo(@RequestParam("category") Integer category) {
        return dictSimpleCategoryService.selectDictInfo(category);
    }
}
